<?php
$key = ftok(__DIR__,'a');
$queue = msg_get_queue($key,0666);
$pid = pcntl_fork();
if ($pid<0){
    exit('fork error'.PHP_EOL);
}else if ($pid>0){
    msg_receive($queue,0,$msgtype,1024,$message);
    echo $message.PHP_EOL;
    msg_remove_queue($queue);
    pcntl_wait($status);
}else if ($pid==0){
    msg_send($queue,1,"helloworld");
    exit;
}
